package thread;

/*
 * @author zzr
 * @date: 2025/04/14  19:34
 * @description:
 */
public class Thread9 {
    private static boolean isQuit = false;

    public static void main(String[] args) throws InterruptedException {
        Thread t = new Thread(() -> {
            while (!isQuit) {
                System.out.println("hello thread");
            }
        });

        System.out.println("t 线程开始 ");
        t.start();
        Thread.sleep(5000);
        System.out.println("t 线程结束");
        isQuit = true;
    }
}
